﻿package mortal.game.view.common.tooltip.tooltips
{
    import Message.DB.Tables.*;
    import Message.Game.*;
    import Message.Public.*;
    import __AS3__.vec.*;
    import baseEngine.modifiers.*;
    import com.greensock.*;
    import com.greensock.easing.*;
    import com.mui.controls.*;
    import com.mui.display.*;
    import com.mui.utils.*;
    import flash.display.*;
    import flash.events.*;
    import flash.geom.*;
    import frEngine.*;
    import frEngine.core.mesh.*;
    import frEngine.effectEditTool.temple.*;
    import frEngine.pools.*;
    import frEngine.primitives.object2d.*;
    import frEngine.render.layer.*;
    import mortal.common.*;
    import mortal.common.global.*;
    import mortal.component.gconst.*;
    import mortal.component.window.*;
    import mortal.game.cache.*;
    import mortal.game.manager.window3d.*;
    import mortal.game.resource.*;
    import mortal.game.resource.info.item.*;
    import mortal.game.resource.tableConfig.*;
    import mortal.game.scene3D.model.data.*;
    import mortal.game.scene3D.model.player.*;
    import mortal.game.scene3D.model.player.weapon.*;
    import mortal.game.scene3D.model.pools.*;
    import mortal.game.scene3D.player.*;
    import mortal.game.scene3D.player.entity.*;
    import mortal.game.scene3D.player.type.*;
    import mortal.game.view.common.*;
    import mortal.game.view.common.display.*;
    import mortal.game.view.common.item.*;
    import mortal.game.view.common.tooltip.tooltips.base.*;
    import mortal.game.view.firstReCharge.*;
    import mortal.game.view.forging.data.*;
    import mortal.game.view.palyer.data.*;
    import mortal.game.view.vip.*;
    import mortal.game.view.wizard.data.*;

    public class TooltipVip extends ToolTipScaleBg implements IWindow3D, IToolTip3D
    {
        protected var _3dBg:GImageBitmap;
        private var _3dName:GTextFiled;
        private var _3dDescItem:EffectItem;
        private var _combatBg:GImageBitmap;
        private var _addComabte:BitmapNumberText;
        private var _vipLevel:BitmapNumberText;
        private var _vipTxt:GImageBitmap;
        private var _bg:ScaleBitmap;
        private var _titleBg:GImageBitmap;
        private var _contentBmd:BitmapData;
        protected var _bodyPlayer:Md5Mesh;
        protected var _mesPlayer:MeshPlayer;
        protected var _hangPlayer:ActionPlayer;
        protected var _roleModelPlayer:UserModelPlayer;
        protected var _effectPlayer:EffectPlayer;
        protected var _effectList:Vector.<EffectPlayer>;
        private var timerContorler:TimeControler;
        protected var _rect3d:Rect3DObject;
        protected var _img2d:Img2D;
        protected var _img2dTitle:Img2D;
        private var _3dBgx:int = 0;
        private var _3dBgy:int = 0;
        private var _tvip:TVip;
        private var _nextVipLevel:int;
        private var tween:TweenMax;
        private var turnNum:Number = 0;
        private var _isDisposed:Boolean;
        protected var _contentTopOf3DSprite:Sprite;

        public function TooltipVip()
        {
            this._effectList = new Vector.<EffectPlayer>;
            this._contentTopOf3DSprite = new Sprite();
            return;
        }// end function

        override public function get width() : Number
        {
            return 360;
        }// end function

        override public function get height() : Number
        {
            return 410;
        }// end function

        protected function createChildren() : void
        {
            this.updateSize(360, 410);
            this._isDisposed = false;
            this.timerContorler = TimeControler.createTimerInstance();
            this.timerContorler.unActive();
            this._3dBg = UIFactory.gImageBitmap(ImagesConst.VipTipsBg, 0, 0, null, this.update3DModule);
            this._bg = UIFactory.bg(0, 0, 360, 410, this, ImagesConst.ToolTipBgBai);
            this._titleBg = UIFactory.gImageBitmap("", 282 - 296, -10, this._contentTopOf3DSprite, this.drawTitle);
            this._3dDescItem = UICompomentPool.getUICompoment(EffectItem);
            this._3dDescItem.setItemStyle(ItemStyleConst.Small, null);
            this._3dDescItem.move(314 - 295, 232 - 208);
            this._contentTopOf3DSprite.addChild(this._3dDescItem);
            this._combatBg = UIFactory.gImageBitmap("", 500 - 265, 220 - 208, this._contentTopOf3DSprite, this.drawTitle);
            this._combatBg.visible = false;
            this._vipTxt = UIFactory.gImageBitmap("", 415 - 335, 368, this._contentTopOf3DSprite, this.drawTitle);
            var _loc_1:* = GlobalStyle.textFormatBai.center();
            _loc_1.size = 18;
            this._3dName = UIFactory.gTextField("", 415 - 68 - 265, 238 - 208, 150, 35, this._contentTopOf3DSprite, _loc_1);
            this._addComabte = UIFactory.bitmapNumberText(128 + 428 - 265, 10 + 215 - 208, "GuildCopyNum.png", 24, 32, -6, this._contentTopOf3DSprite, 9, BitmapNumberText.Mid);
            this._vipLevel = UIFactory.bitmapNumberText(415 - 240, 363, "GuildCopyNum.png", 24, 32, -6, this._contentTopOf3DSprite, 9, BitmapNumberText.Mid);
            return;
        }// end function

        override public function set data(param1) : void
        {
            super.data = param1;
            this._tvip = param1;
            this._nextVipLevel = (Cache.instance.vip.level + 1) > 0 ? ((Cache.instance.vip.level + 1)) : (1);
            this.addEventListener(Event.REMOVED_FROM_STAGE, this.removeFromeStageHandler);
            this.createChildren();
            this.updatePosition();
            this.dispatchEvent(new WindowEvent(WindowEvent.SHOW_END));
            return;
        }// end function

        public function updatePosition() : void
        {
            this.dispatchEvent(new WindowEvent(WindowEvent.POSITIONCHANGE));
            return;
        }// end function

        private function modelTurn() : void
        {
            var _loc_1:* = this.turnNum + 0.05;
            this.turnNum = this.turnNum + 0.05;
            this._bodyPlayer.y = this._bodyPlayer.y + Math.cos(_loc_1) * 0.8;
            this._bodyPlayer.rotationY = this._bodyPlayer.rotationY + 2;
            return;
        }// end function

        private function drawTitle() : void
        {
            if (this._isDisposed || this._titleBg.bitmapData == null || this._combatBg.bitmapData == null || this._vipTxt.bitmapData == null)
            {
                return;
            }
            if (this._rect3d)
            {
                if (this._img2dTitle)
                {
                    this._img2dTitle.dispose(true);
                }
                this._contentBmd = new BitmapData(this._contentTopOf3DSprite.width, this._contentTopOf3DSprite.height, true, 16777215);
                this._contentBmd.draw(this._contentTopOf3DSprite);
                this._img2dTitle = new Img2D(null, this._contentBmd, new Rectangle(0, 0, this._contentBmd.width, this._contentBmd.height), true);
                this._img2dTitle.autoDispose = false;
                this._img2dTitle.x = 0;
                this._img2dTitle.y = 0;
                this._rect3d.addImg(this._img2dTitle, Layer3DManager.particleLayer);
            }
            return;
        }// end function

        private function update3DModule() : void
        {
            var _loc_2:Array = null;
            var _loc_3:Array = null;
            var _loc_4:int = 0;
            var _loc_5:String = null;
            var _loc_6:String = null;
            var _loc_7:String = null;
            var _loc_8:* = undefined;
            var _loc_9:int = 0;
            var _loc_10:ItemData = null;
            var _loc_11:int = 0;
            var _loc_12:Number = NaN;
            var _loc_13:Boolean = false;
            var _loc_14:int = 0;
            var _loc_15:int = 0;
            var _loc_16:int = 0;
            var _loc_17:int = 0;
            var _loc_18:int = 0;
            var _loc_19:TModel = null;
            var _loc_20:WizardData = null;
            var _loc_21:int = 0;
            var _loc_22:ItemEquipInfo = null;
            var _loc_23:EffectPlayer = null;
            var _loc_24:int = 0;
            var _loc_25:TTitle = null;
            var _loc_26:TSkill = null;
            var _loc_27:TSkillModel = null;
            var _loc_28:int = 0;
            var _loc_29:TMountConfig = null;
            var _loc_30:Point = null;
            var _loc_31:int = 0;
            var _loc_32:FashionAdvanceData = null;
            var _loc_33:int = 0;
            var _loc_34:int = 0;
            var _loc_35:TPlayerModel = null;
            if (this._isDisposed)
            {
                return;
            }
            var _loc_1:* = new Rectangle(this._3dBgx + 10, this._3dBgy + paddingTop + 7, 350, 400);
            this._rect3d = Rect3DManager.instance.registerWindow(true, _loc_1, this, true);
            Rect3DManager.instance.windowShowHander(null, this);
            if (this._3dBg.bitmapData)
            {
                if (this._img2d)
                {
                    this._img2d.dispose(true);
                }
                this._img2d = new Img2D(null, this._3dBg.bitmapData, new Rectangle(0, 0, 350, 400), false);
                this._img2d.autoDispose = false;
                this._img2d.x = 0;
                this._img2d.y = 0;
                this._rect3d.addImg(this._img2d);
            }
            if (this._rect3d)
            {
                _loc_2 = (this._tvip["vip" + this._nextVipLevel] as String).split("#");
                _loc_3 = (_loc_2[1] as String).split("&");
                _loc_4 = _loc_2[0];
                if (_loc_2[2])
                {
                    this._3dName.text = _loc_2[2];
                }
                if (int(_loc_2[3]) > 0)
                {
                    this._addComabte.text = _loc_2[3];
                    this._combatBg.visible = true;
                    this._3dName.x = 415 - 68 - 265;
                    this._combatBg.imgUrl = ImagesConst.VipAddCombatBg;
                }
                else if (int(_loc_2[3]) == 0)
                {
                    this._combatBg.visible = true;
                    this._combatBg.imgUrl = _loc_2[3];
                    this._addComabte.text = "";
                    this._3dName.x = 415 - 68 - 275;
                }
                else if (int(_loc_2[3]) < 0)
                {
                    this._addComabte.text = "";
                    this._combatBg.visible = false;
                    this._3dName.x = 415 - 68 - 265;
                    this._combatBg.imgUrl = ImagesConst.VipAddCombatBg;
                }
                if (_loc_2[4])
                {
                    this._3dDescItem.itemData = new ItemData(int(_loc_2[4]));
                }
                this._vipLevel.text = this._nextVipLevel + "";
                _loc_13 = _loc_2[5] == "1";
                _loc_12 = int(_loc_2[6]) * 0.01;
                _loc_18 = -265;
                _loc_11 = _loc_2[7] - 40;
                if (_loc_3)
                {
                    _loc_9 = _loc_3[0];
                }
                else
                {
                    _loc_9 = int(_loc_2[1]);
                }
                _loc_10 = new ItemData(_loc_9);
                if (this._bodyPlayer)
                {
                    if (this._bodyPlayer is WizardActionPlayer)
                    {
                        (this._bodyPlayer as WizardActionPlayer).clearExtend();
                        this.timerContorler.unActive();
                    }
                    if (this._bodyPlayer is ActionPlayer)
                    {
                        (this._bodyPlayer as ActionPlayer).unHang(this._bodyPlayer as ActionPlayer);
                    }
                    this._rect3d.disposeObj3d(this._bodyPlayer);
                }
                this._titleBg.imgUrl = ImagesConst.VipPanelRewardTitleBg;
                this._vipTxt.imgUrl = ImagesConst.VipTipsTxt_1;
                this.remove3dPlayer();
                switch(_loc_4)
                {
                    case VipModelConst.Chlose:
                    {
                        _loc_8 = PlayerModelConfig.instance.getModelInfo(ModelType.CLOTHES, (_loc_10.itemInfo as ItemEquipInfo).modelId, Cache.instance.role.entityInfo.sex, Cache.instance.role.entityInfo.career);
                        _loc_5 = _loc_8.mesh + ".md5mesh";
                        _loc_6 = _loc_8.bone + ".skeleton";
                        _loc_7 = _loc_8.texture;
                        break;
                    }
                    case VipModelConst.Wing:
                    {
                        _loc_8 = PlayerModelConfig.instance.getModelInfo(ModelType.WING, (_loc_10.itemInfo as ItemEquipInfo).modelId, Cache.instance.role.entityInfo.sex, Cache.instance.role.entityInfo.career);
                        _loc_5 = _loc_8.mesh + ".md5mesh";
                        _loc_6 = _loc_8.bone + ".skeleton";
                        _loc_7 = _loc_8.texture;
                        break;
                    }
                    case VipModelConst.Weapon:
                    {
                        _loc_8 = PlayerModelConfig.instance.getModelInfo(ModelType.WEAPONS, (_loc_10.itemInfo as ItemEquipInfo).modelId, Cache.instance.role.entityInfo.sex, Cache.instance.role.entityInfo.career);
                        _loc_5 = _loc_8.mesh + ".md5mesh";
                        _loc_6 = _loc_8.bone + ".skeleton";
                        _loc_7 = _loc_8.texture;
                        break;
                    }
                    case VipModelConst.Headdress:
                    {
                        break;
                    }
                    case VipModelConst.Sprite:
                    {
                        _loc_20 = new WizardData(_loc_10.itemInfo.effect);
                        _loc_8 = ModelConfig.instance.getInfoByCode(int(_loc_20.tSprite.modelId));
                        _loc_5 = _loc_8.mesh1 + ".md5mesh";
                        _loc_6 = _loc_8.bone1 + ".skeleton";
                        _loc_7 = _loc_8.texture1;
                        break;
                    }
                    case VipModelConst.Gem:
                    {
                        _loc_8 = ModelConfig.instance.getInfoByType(_loc_10.itemInfo.type);
                        _loc_21 = _loc_10.itemInfo.color;
                        if (_loc_8)
                        {
                            _loc_5 = _loc_8["mesh" + (_loc_21 - 1)];
                            _loc_7 = _loc_8["texture" + (_loc_21 - 1)];
                        }
                        break;
                    }
                    case VipModelConst.TITLE:
                    {
                        break;
                    }
                    case VipModelConst.SKILL:
                    {
                        break;
                    }
                    case VipModelConst.advanceSystem:
                    {
                        break;
                    }
                    default:
                    {
                        break;
                    }
                }
                if (this.tween && this.tween.active)
                {
                    this.tween.kill();
                }
                if (_loc_4 == VipModelConst.Sprite)
                {
                    _loc_19 = _loc_8 as TModel;
                    this._bodyPlayer = FrObjectPool.getObject(WizardActionPlayer, this);
                    (this._bodyPlayer as ActionPlayer).load(_loc_5, _loc_6, _loc_7);
                    this._rect3d.addObject3d(this._bodyPlayer, 126 + 314 + _loc_18, _loc_11);
                    (this._bodyPlayer as WizardActionPlayer).clearExtend();
                    (this._bodyPlayer as WizardActionPlayer).load(_loc_5, _loc_6, _loc_8.texture1, this._rect3d.renderList);
                    if (_loc_19.mesh2)
                    {
                        _loc_5 = _loc_19.mesh2 + ".md5mesh";
                        _loc_6 = _loc_19.bone2 + ".skeleton";
                        (this._bodyPlayer as WizardActionPlayer).loadExtend(_loc_5, _loc_6, _loc_19.texture2, this._rect3d.renderList);
                        (this._bodyPlayer as WizardActionPlayer).extendPlayer.timerContorler = this.timerContorler;
                    }
                    (this._bodyPlayer as ActionPlayer).play();
                    (this._bodyPlayer as ActionPlayer).scaleValue = _loc_12;
                    this._bodyPlayer.timerContorler = this.timerContorler;
                    this.timerContorler.active();
                }
                else if (_loc_4 == VipModelConst.Chlose)
                {
                    _loc_22 = ItemConfig.instance.getConfig((_loc_10.itemInfo as ItemEquipInfo).effect) as ItemEquipInfo;
                    this._roleModelPlayer = FrObjectPool.getObject(UserModelPlayer, this);
                    _loc_14 = Cache.instance.role.entityInfo.career;
                    _loc_15 = Cache.instance.role.entityInfo.sex;
                    _loc_16 = _loc_22 ? (_loc_22.modelId) : (0);
                    _loc_17 = 10;
                    this._roleModelPlayer.updateInfo(_loc_14, _loc_15, (_loc_10.itemInfo as ItemEquipInfo).modelId, 0, _loc_16, _loc_17, 0);
                    this._roleModelPlayer.scaleAll = _loc_12;
                    this._roleModelPlayer.rotationX = 0;
                    this._roleModelPlayer.rotationY = 0;
                    this._roleModelPlayer.useLight();
                    this._roleModelPlayer.setRenderList(this._rect3d.renderList);
                    this._rect3d.addObject3d(this._roleModelPlayer, 170, _loc_11);
                }
                else if (_loc_4 == VipModelConst.Wing)
                {
                    this._roleModelPlayer = FrObjectPool.getObject(UserModelPlayer, this);
                    _loc_14 = Cache.instance.role.entityInfo.career;
                    _loc_15 = Cache.instance.role.entityInfo.sex;
                    _loc_16 = 0;
                    _loc_17 = 0;
                    this._roleModelPlayer.updateIsShowEffect(true, true, true);
                    this._roleModelPlayer.updateInfo(_loc_14, _loc_15, Cache.instance.role.roleEntityInfo.clothes, 0, _loc_16, (_loc_10.itemInfo as ItemEquipInfo).modelId, _loc_17, Cache.instance.role.roleEntityInfo.isHideWing);
                    this._roleModelPlayer.scaleAll = _loc_12;
                    this._roleModelPlayer.rotationX = 0;
                    this._roleModelPlayer.rotationY = 0;
                    this._roleModelPlayer.useLight();
                    this._roleModelPlayer.setRenderList(this._rect3d.renderList);
                    this._rect3d.addObject3d(this._roleModelPlayer, 124 + 314 + _loc_18, _loc_11);
                }
                else if (_loc_4 == VipModelConst.Weapon)
                {
                    this._bodyPlayer = FrObjectPool.getObject(ActionPlayer, this);
                    this._bodyPlayer.enabledPool = false;
                    (this._bodyPlayer as ActionPlayer).load(_loc_5, _loc_6, _loc_7);
                    this._bodyPlayer.timerContorler = this.timerContorler;
                    var _loc_36:* = _loc_12;
                    (this._bodyPlayer as ActionPlayer).scaleZ = _loc_12;
                    var _loc_36:* = _loc_36;
                    (this._bodyPlayer as ActionPlayer).scaleY = _loc_36;
                    (this._bodyPlayer as ActionPlayer).scaleX = _loc_36;
                    this._rect3d.addObject3d(this._bodyPlayer, 147, _loc_11);
                    if (_loc_13)
                    {
                        this._effectPlayer = EffectPlayerPool.instance.getEffectPlayer(_loc_8.selfEffect, this._bodyPlayer, this._rect3d.renderList, false);
                        this._effectPlayer.play(PlayMode.ANIMATION_LOOP_MODE);
                        if (this._effectPlayer.temple is TempleRole)
                        {
                            (this._effectPlayer.temple as TempleRole).setRoleParams(this._bodyPlayer, null, null);
                        }
                        this._bodyPlayer.rotationZ = -20;
                        this.tween = TweenMax.to(this._bodyPlayer, 0.01, {ease:Quint.easeIn, repeat:-1, onRepeat:this.modelTurn});
                    }
                    else
                    {
                        while (_loc_24 < 4)
                        {
                            
                            _loc_23 = EffectPlayerPool.instance.getEffectPlayer(_loc_8.selfEffect, this._bodyPlayer, this._rect3d.renderList, false);
                            _loc_23.play(PlayMode.ANIMATION_LOOP_MODE);
                            if (_loc_23.temple is TempleRole)
                            {
                                (_loc_23.temple as TempleRole).setRoleParams(this._bodyPlayer, null, null);
                            }
                            _loc_23.hangBoneName = "Bone00" + (2 * _loc_24 + 1);
                            (this._bodyPlayer as ActionPlayer).hang(_loc_23);
                            _loc_24++;
                        }
                        (this._bodyPlayer as ActionPlayer).changeAction(ActionName.Stand);
                        (this._bodyPlayer as ActionPlayer).play();
                    }
                    this.timerContorler.active();
                }
                else if (_loc_4 == VipModelConst.Gem)
                {
                    this._effectPlayer = EffectPlayerPool.instance.getEffectPlayer(ForgingConst.EffectPath4, null, this._rect3d.renderList, false);
                    this._effectPlayer.play(PlayMode.ANIMATION_LOOP_MODE);
                    this._mesPlayer = FrObjectPool.getObject(MeshPlayer, this);
                    this._mesPlayer.load(_loc_5 + ".mesh", _loc_7, this._rect3d.renderList);
                    this._mesPlayer.hangBoneName = BoneConst.MountHangModelBone;
                    this._effectPlayer.hang(this._mesPlayer, "parent1");
                    var _loc_36:* = _loc_12;
                    this._effectPlayer.scaleZ = _loc_12;
                    var _loc_36:* = _loc_36;
                    this._effectPlayer.scaleY = _loc_36;
                    this._effectPlayer.scaleX = _loc_36;
                    this._rect3d.addObject3d(this._effectPlayer, 126 + 314 + _loc_18, _loc_11);
                }
                else if (_loc_4 == VipModelConst.TITLE)
                {
                    _loc_25 = TitleConfig.instance.getInfoById(_loc_9);
                    this._effectPlayer = EffectPlayerPool.instance.getEffectPlayer(_loc_25.icon, null, this._rect3d.renderList, false);
                    this._effectPlayer.play();
                    var _loc_36:* = _loc_12;
                    this._effectPlayer.scaleZ = _loc_12;
                    var _loc_36:* = _loc_36;
                    this._effectPlayer.scaleY = _loc_36;
                    this._effectPlayer.scaleX = _loc_36;
                    this._rect3d.addObject3d(this._effectPlayer, 120 + 314 + _loc_18, _loc_11);
                }
                else if (_loc_4 == VipModelConst.SKILL)
                {
                    _loc_26 = SkillConfig.instance.getInfoById(_loc_9);
                    _loc_27 = SkillModelConfig.instance.getInfoById(_loc_26.skillModel);
                    this._effectPlayer = EffectPlayerPool.instance.getEffectPlayer(_loc_27.selfModel, null, this._rect3d.renderList, false);
                    this._effectPlayer.play();
                    var _loc_36:* = _loc_12;
                    this._effectPlayer.scaleZ = _loc_12;
                    var _loc_36:* = _loc_36;
                    this._effectPlayer.scaleY = _loc_36;
                    this._effectPlayer.scaleX = _loc_36;
                    this._rect3d.addObject3d(this._effectPlayer, 120 + 314 + _loc_18, _loc_11);
                }
                else if (_loc_4 == VipModelConst.advanceSystem)
                {
                    if (_loc_9 == 1)
                    {
                        _loc_28 = Cache.instance.mount.mountData.mountLevel > 3 ? (Cache.instance.mount.mountData.mountLevel) : (3);
                        _loc_29 = MountConfig.instance.getMountInfoByCode(_loc_28);
                        _loc_8 = ModelConfig.instance.getInfoByCode(_loc_29.modelId);
                        _loc_30 = new Point(126 + 314 + _loc_18, _loc_11);
                        if (_loc_28 == 10)
                        {
                            _loc_31 = 0;
                        }
                        else
                        {
                            _loc_31 = 50;
                        }
                        this._bodyPlayer = FrObjectPool.getObject(ActionPlayer, this);
                    }
                    else
                    {
                        switch(_loc_14)
                        {
                            case ECareer._ECareerWarrior:
                            {
                                break;
                            }
                            case ECareer._ECareerArcher:
                            {
                                break;
                            }
                            case ECareer._ECareerMage:
                            {
                                break;
                            }
                            default:
                            {
                                break;
                            }
                        }
                        if (_loc_9 == 3)
                        {
                        }
                        else if (_loc_9 == 4)
                        {
                        }
                        else if (_loc_9 == 5)
                        {
                        }
                    }
                    if (_loc_8 is TModel)
                    {
                        _loc_5 = _loc_8.mesh1 + ".md5mesh";
                        _loc_6 = _loc_8.bone1 + ".skeleton";
                        (this._bodyPlayer as ActionPlayer).load(_loc_5, _loc_6, _loc_8.texture1, this._rect3d.renderList);
                        (this._bodyPlayer as ActionPlayer).changeAction(ActionName.MountStand);
                        (this._bodyPlayer as ActionPlayer).scaleValue = _loc_12;
                        (this._bodyPlayer as ActionPlayer).play();
                        this._effectPlayer = EffectPlayerPool.instance.getEffectPlayer(_loc_8.effect1, this._bodyPlayer, this._rect3d.renderList, false);
                    }
                    else if (_loc_8 is TPlayerModel)
                    {
                        _loc_5 = _loc_8.mesh + ".md5mesh";
                        (this._bodyPlayer as WeaponPlayer).load(_loc_5, _loc_8.texture, this._rect3d.renderList);
                        (this._bodyPlayer as WeaponPlayer).rotationZ = -20;
                        var _loc_36:* = _loc_12;
                        (this._bodyPlayer as WeaponPlayer).scaleZ = _loc_12;
                        var _loc_36:* = _loc_36;
                        (this._bodyPlayer as WeaponPlayer).scaleY = _loc_36;
                        (this._bodyPlayer as WeaponPlayer).scaleX = _loc_36;
                        (this._bodyPlayer as WeaponPlayer).play();
                        this._effectPlayer = EffectPlayerPool.instance.getEffectPlayer(_loc_8.selfEffect, this._bodyPlayer, this._rect3d.renderList, false);
                        this.tween = TweenMax.to(this._bodyPlayer, 0.01, {ease:Quint.easeIn, repeat:-1, onRepeat:this.modelTurn});
                    }
                    this._bodyPlayer.rotationY = _loc_31;
                    this._rect3d.addObject3d(this._bodyPlayer, _loc_30.x, _loc_30.y);
                    if (this._effectPlayer.temple is TempleRole)
                    {
                        (this._effectPlayer.temple as TempleRole).setRoleParams(this._bodyPlayer, null, null);
                    }
                    this._effectPlayer.play(PlayMode.ANIMATION_LOOP_MODE);
                }
                if (_loc_8 is TModel && _loc_8.bone2)
                {
                    if (!this._hangPlayer)
                    {
                        this._hangPlayer = FrObjectPool.getObject(ActionPlayer, this);
                        this._hangPlayer.changeAction(ActionName.Stand);
                        this._hangPlayer.selectEnabled = true;
                        this._hangPlayer.play();
                    }
                    _loc_5 = _loc_8.mesh2 + ".md5mesh";
                    _loc_6 = _loc_8.bone2 + ".skeleton";
                    this._hangPlayer.load(_loc_5, _loc_6, _loc_8.texture2);
                    this._hangPlayer.alpha = 1;
                    this._hangPlayer.hangBoneName = BoneConst.ModelHangWingBone;
                    (this._bodyPlayer as ActionPlayer).hang(this._hangPlayer);
                }
            }
            return;
        }// end function

        public function get contentContainer() : Sprite
        {
            return this;
        }// end function

        public function get contentTopOf3DSprite() : Sprite
        {
            return this._contentTopOf3DSprite;
        }// end function

        protected function removeFromeStageHandler(event:Event) : void
        {
            this._isDisposed = true;
            this._titleBg.dispose();
            this._titleBg = null;
            this._3dBg.dispose();
            this._3dBg = null;
            this._combatBg.dispose();
            this._combatBg = null;
            this._3dName.dispose();
            this._3dName = null;
            this._3dDescItem.dispose();
            this._3dDescItem = null;
            this._addComabte.dispose();
            this._addComabte = null;
            this._bg.dispose();
            this._bg = null;
            this._vipTxt.dispose();
            this._vipTxt = null;
            this._vipLevel.dispose();
            this._vipLevel = null;
            if (this.tween && this.tween.active)
            {
                this.tween.kill();
            }
            if (this._img2d)
            {
                this._img2d.dispose(true);
                this._img2d = null;
            }
            if (this._img2dTitle)
            {
                this._img2dTitle.dispose(true);
                this._img2dTitle = null;
            }
            if (this._contentBmd)
            {
                this._contentBmd.dispose();
                this._contentBmd = null;
            }
            this.remove3dPlayer();
            if (this._rect3d)
            {
                Rect3DManager.instance.closeEndHander(null, this);
                this._rect3d = null;
            }
            this._tvip = null;
            this.removeEventListener(Event.REMOVED_FROM_STAGE, this.removeFromeStageHandler);
            this.dispatchEvent(new WindowEvent(WindowEvent.CLOSE_END));
            return;
        }// end function

        private function remove3dPlayer() : void
        {
            var _loc_1:EffectPlayer = null;
            if (this._bodyPlayer)
            {
                this.timerContorler.unActive();
                if (this._bodyPlayer is ActionPlayer)
                {
                    (this._bodyPlayer as ActionPlayer).unHang(this._bodyPlayer as ActionPlayer);
                }
                this._rect3d.disposeObj3d(this._bodyPlayer);
                this._bodyPlayer = null;
            }
            if (this._roleModelPlayer)
            {
                this._rect3d.disposeObj3d(this._roleModelPlayer);
                this._roleModelPlayer = null;
            }
            if (this._hangPlayer)
            {
                this._rect3d.disposeObj3d(this._hangPlayer);
                this._hangPlayer = null;
            }
            if (this._effectPlayer)
            {
                this._rect3d.disposeObj3d(this._effectPlayer);
                this._effectPlayer = null;
            }
            if (this._mesPlayer)
            {
                this._rect3d.disposeObj3d(this._mesPlayer);
                this._mesPlayer = null;
            }
            for each (_loc_1 in this._effectList)
            {
                
                this._rect3d.disposeObj3d(_loc_1);
            }
            this._effectList.length = 0;
            return;
        }// end function

    }
}
